<?php

	$user_result = mysql_query("SELECT * FROM users WHERE username='{$_SESSION['username']}'");
	$user_id = mysql_result($user_result, 0, "id");
	$hospital_id = mysql_result(mysql_query("SELECT id FROM hospitals WHERE owner_id=$user_id"), 0);	
	$numemployees = mysql_num_rows(mysql_query("SELECT id FROM employees WHERE hospital_id=$hospital_id"));

	echo "<fieldset>";
	echo "<legend><b>Employee Information</b></legend>";
	echo "<ul>";
	echo "<li><b><u>Total Employees:</u></b> $numemployees</li>";
	for ($i = 0; $i < mysql_num_rows(mysql_query("SELECT name FROM employee_types")); $i++)
	{
		$result = mysql_query("SELECT id,name FROM employee_types");
		$emp_id = mysql_result($result, $i, "id");
		$emp_type = mysql_result($result, $i, "name");
		$num = mysql_num_rows(mysql_query("SELECT id FROM employees WHERE occupation_id='$emp_id' AND hospital_id='$hospital_id'"));
		if ($num != NULL) {
			echo "<li><u>{$emp_type}s:</u> $num</li>";
		}
		else {
			echo "<li><u>{$emp_type}s:</u> 0</li>";
		}
	}
	echo "</ul>";
	echo "<a href='index.php?view=hireemployees'>Hire More Employees</a>";
	echo "<br /></fieldset>";

?>
